Skip to content

fix: (os error 123): readfile '/C:/path/to/project/index.ts'#89

Open
bacek97 wants to merge 1 commit into
denoland:mainfrom
bacek97:fix-windows-paths
Open

fix: (os error 123): readfile '/C:/path/to/project/index.ts'#89
bacek97 wants to merge 1 commit into
denoland:mainfrom
bacek97:fix-windows-paths

Conversation

@bacek97
Copy link
Copy Markdown

@bacek97 bacek97 commented May 11, 2026

Fixes the bug where deno deploy on Windows fails to upload any file, surfacing as (os error 123): readfile '/C:/path/to/project/index.ts'.

C:\path\to\project> deno deploy --prod --org=bacek97 --app=app .
⠋ Publishing 'C:\path\to\project'
✗ An error occurred:
  Синтаксическая ошибка в имени файла, имени папки или метке тома. (os error 123): readfile '/C:/path/to/project/index.ts'

The root cause is in collect_files, which returned file paths to JS via path.to_string_lossy(). Because rs_lib is compiled to wasm32-unknown-unknown, PathBuf uses Unix separators and sys_traits::wasm_string_to_path rewrites Windows absolute paths to a Unix-like form (C:\foo/C:/foo) when crossing into WASM. Every other path leaving WASM goes through sys_traits::wasm_path_to_str, which reverses that rewrite — but collect_files skipped it, so JS received /C:/... strings and passed them straight to Deno.readFile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant